import axios from './api'
export const menuListQuery = params => {
  return axios.post('/v1/sysMenu/menuListQuery', params).then(res => res.data)
}
export const menuList = () => {
  return axios.get('/v1/sysMenu/menuListByCurrentUser').then(res => res.data)
}
export const getMenu = params => {
  return axios.get(`/v1/sysMenu/get/${params}`).then(res => res.data)
}
export const updateMenu = params => {
  return axios.put(`/v1/sysMenu/update`, params).then(res => res.data)
}
export const createMenu = params => {
  return axios.post(`/v1/sysMenu/create`, params).then(res => res.data)
}
export const menuListByName = params => {
  return axios
    .get(`/v1/sysMenu/menuListByName?menuName=${params}`)
    .then(res => res.data)
}
export const deleteMenu = params => {
  return axios.delete(`/v1/sysMenu/delete/${params}`).then(res => res.data)
}
export const treeNodes = params => {
  return axios.get(`/v1/sysMenu/treeNodes/${params}`).then(res => res.data)
}
export const changeTreeNodes = params => {
  return axios.put(`/v1/sysMenu/changeTreeNodes`, params).then(res => res.data)
}
